<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="box"></div>
    <script>
        // const boxDom = document.getElementById('box');
        // new Promise(function (resolve, reject) {
        //     setTimeout(function () {
        //         resolve('成功')
        //     }, 2000)
        // }).then(res => {
        //     boxDom.innerText = '我来了';
        //     console.log(res)
        // })
        console.time('time')
        function createDom() {
            for (let i = 0; i < 100; i++) {
                const ele = document.createElement('div');
                ele.innerText = '我来了';
                document.body.appendChild(ele)
            }
        }
        createDom()
        // createDom()
        // createDom()
        // createDom()
        // createDom()
        // createDom()
        // createDom()
        // createDom()
        // createDom()
        // createDom()
        console.timeEnd('time');
    </script>
</body>

</html>